package com.ruoyi.model.comment;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.Date;
import java.util.List;

/**
 * 评论模块对象 web_comment
 *
 * @author 张怀秋
 * &#064;date  2024-03-21
 */
@TableName("web_comment")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class Comment extends BaseEntity {

    /**
     * 评论id
     */
    @TableId(type = IdType.ASSIGN_ID)
    private String id;
    @TableField(exist = false)

    private String toCommentName;

    /**
     * 评论类型(代表对文章或者活动和竞赛的区分)
     */
    @Excel(name = "评论类型(代表对文章或者活动和竞赛的区分)")
    private String type;

    /**
     * 被评论的数据的id
     */
    @Excel(name = "被评论的数据的id")
    private String activityId;

    /**
     * 根评论id
     */
    @Excel(name = "根评论id")
    private String rootId;

    /**
     * 评论内容
     */
    @Excel(name = "评论内容")
    private String content;

    private String userName;

    private String userId;

    /**
     * 所回复的目标评论的user_id
     */
    @Excel(name = "所回复的目标评论的user_id")
    private String toCommentUserId;

    /**
     * 回复目标评论id
     */
    @Excel(name = "回复目标评论id")
    private String toCommentId;


    @TableField(exist = false)
    private List<Comment> children;

    /**
     * 逻辑删除
     */
    @Excel(name = "逻辑删除")
    @TableLogic
    private String isDel;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date pushTime;


}
